import {createBrowserRouter} from 'react-router-dom'
// 导入一级路由模块
import Layout from '@/pages/layout/index'
import Login from '@/pages/login/index'
import { AuthRoute } from '@/components/AuthRoute'

// 导入二级路由模块
import Home from '@/pages/layout/home/index'
import Article from '@/pages/layout/article/index'
import Publish from '@/pages/layout/publish/index'

const router = createBrowserRouter([
    {
        path: '/',
        element: <AuthRoute> <Layout /> </AuthRoute>,
        children: [
            {
                index: true,
                // path: '/home',
                element: <Home />
            },
            {
                path: 'article',
                element: <Article />
            },
            {
                path: 'publish',
                element: <Publish />
            }
        ]

    },
    {
        path: '/login',
        element: <Login />
    }
])

export default router